<template>
  <div>
    <van-button @click="open = true">Open Modal</van-button>
    <CustomModal :show="open">
      <h3 class="modal_title">请勾选相关协议</h3>
      <div class="agreement_text">
        我同意并遵守你的《用户服务协议》、 《隐私协议》
      </div>

      <div class="feedback_btns">
        <van-button
          type="default"
          size="large"
          round
          class="cancel_btn"
          @click="open = false"
          >取消</van-button
        >
        <van-button
          type="danger"
          size="large"
          round
          class="agree_btn"
          @click="open = false"
          >同意</van-button
        >
      </div>
    </CustomModal>
  </div>
</template>
<script lang="ts">
export default defineComponent({
  name: 'Modal',
  setup() {
    const open = ref(false);
    const isDisable = ref(false);
    return {
      open,
      isDisable,
    };
  },
});
</script>
<style scoped>
.modal {
  position: fixed;
  z-index: 999;
  top: 20%;
  left: 50%;
  width: 300px;
  margin-left: -150px;
}

.modal_title {
  font-size: 17px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
  margin-bottom: 16px;
}
.agreement_text {
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.feedback_btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  .van-button {
    width: 120px;
    height: 40px;
  }
}

.protocol {
  color: #f02d2d;
}
</style>
